UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ls3qdxxpryZo68i4e1SZgyn1ryiYmuiwfKDFCNUaLPM='
WHERE
key_id = '88553fed95a9df023d4b6fcfb717a0a60326937ab04243de246096abaed92d57'
AND (
token = 'Ls3qdxxpryZo68i4e1SZgyn1ryiYmuiwfKDFCNUaLPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)