UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Aggr5pwpYRVhNkNNWfIbXWpbzQOYPXfvEw9uG9uJpu0='
WHERE
key_id = '1a2ce4ad70f35385d8679953bfe0801df14a348f2159292a5331f8f78f6953fa'
AND (
token = 'Aggr5pwpYRVhNkNNWfIbXWpbzQOYPXfvEw9uG9uJpu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)