UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'veKpnJEOHYRkX3dYXg8Vyr46QDRdrBMc3MA1wZRS7Ek='
WHERE
key_id = '35c3175734b4715455b66852e5b36a174f3da05230a4dc96075489e4b5bda35e'
AND (
token = 'veKpnJEOHYRkX3dYXg8Vyr46QDRdrBMc3MA1wZRS7Ek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)