UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xgXGNjtQxzhD8Y45H8J9jvWdI7giRKUrNDpqrLQw0No='
WHERE
key_id = '8ae1afffde168eb3fc07aed712ec0a4beea154ee79c331c3c30cb48f482c0377'
AND (
token = 'xgXGNjtQxzhD8Y45H8J9jvWdI7giRKUrNDpqrLQw0No='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)