UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jRDPh+r6R5aF2KVYmJDgLV5o4iK1MGvwIeCSVMgwV9s='
WHERE
key_id = '1937aa5a9ea93ae3f2b58385b77f3a3249c86eb3c23f18510b01bb28a1b12efc'
AND (
token = 'jRDPh+r6R5aF2KVYmJDgLV5o4iK1MGvwIeCSVMgwV9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)