UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6kwHvfvERjIQD63mwLtmYX2ngyArplrkYIc1/+EBo/o='
WHERE
key_id = '7f0155e22f208f7182281bab7e04640aa3eef64ff0b68c9ac0f7b0876e321859'
AND (
token = '6kwHvfvERjIQD63mwLtmYX2ngyArplrkYIc1/+EBo/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)