UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'riQk8N8DvSAtjMvKD7kkEcR4cx7YgcY6dh+dGuLspUQ='
WHERE
key_id = 'a8ea9ad8c7b4615997e44f8c5ac81c02c119ed40ace71b2fb05572d341ae9046'
AND (
token = 'riQk8N8DvSAtjMvKD7kkEcR4cx7YgcY6dh+dGuLspUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)