UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0tu7uDXWzbglPR5HN0n5mCTw04RfPGJ0BhuXQJTuZIE='
WHERE
key_id = 'b94b8e6b699ac37783f7e56d28161eaf1f8fe6db970a8b5992faa6abdb04dddf'
AND (
token = '0tu7uDXWzbglPR5HN0n5mCTw04RfPGJ0BhuXQJTuZIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)