UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y734NaPp4eL8ECE/2C//xZY62itt9i4n4zVJYISjhO4='
WHERE
key_id = '0243fc9e71e1d10ea8bc72761bad8eefc046224f71f583a92c7210bdebfb2fb9'
AND (
token = 'Y734NaPp4eL8ECE/2C//xZY62itt9i4n4zVJYISjhO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)