UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Fmmt2/GJs2lih0ZfXn1zrtW9fM3VukA4jCM2Dw36ME='
WHERE
key_id = 'f6b2a28af98b36c4c04a8b2ee2a57423a0ca5d39b53d8e6bf9272bd8f85e29dd'
AND (
token = '3Fmmt2/GJs2lih0ZfXn1zrtW9fM3VukA4jCM2Dw36ME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)