UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'irRSI/vmAnyYDS6iSUJIc5wpJySy/2zfwSwlgVHSSLY='
WHERE
key_id = 'efdb350486345ebef3cf68ed966289fef5ca45b8ffa81c967b0bc2d8449b6660'
AND (
token = 'irRSI/vmAnyYDS6iSUJIc5wpJySy/2zfwSwlgVHSSLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)