UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '13dVAFPot47LtECk/7mu+IyapryBCzbz8sj3fyBPK30='
WHERE
key_id = '4c55c16bf1eb02f4b4862f901202ed9a0de61e763f55727566580321dc20cea0'
AND (
token = '13dVAFPot47LtECk/7mu+IyapryBCzbz8sj3fyBPK30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)