UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ooJdFN4a/2bLmv+Ic9+1D02NDVIspJsCscNMQS0YvzI='
WHERE
key_id = '0de8ba1e2fc9406675363e70ed2da73608b29a434bb43c9ee3d2a701c08ad9bc'
AND (
token = 'ooJdFN4a/2bLmv+Ic9+1D02NDVIspJsCscNMQS0YvzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)