UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uBQk9Huvr8Hx0/gpGG/cSlEvzQ30rDsUDTxJNbqV0b8='
WHERE
key_id = 'df9b4cd3a40bb44801472fcede7c57b5582bff9a70cf0e00c53cdaa9db7841b3'
AND (
token = 'uBQk9Huvr8Hx0/gpGG/cSlEvzQ30rDsUDTxJNbqV0b8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)