UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u3crkj9teG6VzTU8hiXxBE/pgWAtcTQjNO4+qe4xghI='
WHERE
key_id = '1ea6d96609fbd5a1753eb19174211530f4a6acea06294a7055e63ea5bc19c1b9'
AND (
token = 'u3crkj9teG6VzTU8hiXxBE/pgWAtcTQjNO4+qe4xghI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)