UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Cf62+owcXumDvlcuG5K366TtbCLJM9NQnp+TN5gQcs='
WHERE
key_id = 'cc7bb7a4a30d3cb1db92af95c5ab77cdb7396dd33880bdd12932264290e34a6b'
AND (
token = '1Cf62+owcXumDvlcuG5K366TtbCLJM9NQnp+TN5gQcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)