UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ErsRYqoDZgdQ1pwTAeDvuThcpxbaRaCcEiK4Fq/fLJc='
WHERE
key_id = '9c5f889e91fd8561c37fad7c97118b569679aff4bf2524286017296c2c4b0ff0'
AND (
token = 'ErsRYqoDZgdQ1pwTAeDvuThcpxbaRaCcEiK4Fq/fLJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)