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