UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gTWJXnf52QHWiKra7Z5sejIuJOT2G8+Pa2mNukj4jxg='
WHERE
key_id = 'ae384b6f6f8caa70f9ae5bf6f6bcc61bfe6ab0c71f237ce610151cf27b2e5339'
AND (
token = 'gTWJXnf52QHWiKra7Z5sejIuJOT2G8+Pa2mNukj4jxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)