UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EkgPYvPiYnasRe294Ahu8+cFO6QgQpwsU/nscQFaUgw='
WHERE
key_id = '27604c33f94eaf5c883882eac4d3d52db3ab6270ad670b69c5d00b26a4f6b414'
AND (
token = 'EkgPYvPiYnasRe294Ahu8+cFO6QgQpwsU/nscQFaUgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)