UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+bu9CoplqfG+N2uuvMCLVsgw0n7dmPXrDJ/E7UiN9r0='
WHERE
key_id = '07de61420f5ea60ce59cb482cdd25b2fa09cf30128c73893a93a776c0aaf41c0'
AND (
token = '+bu9CoplqfG+N2uuvMCLVsgw0n7dmPXrDJ/E7UiN9r0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)