UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gn3Yw8RbH7Sek3UZPuyTsGivgX7LnuLbPkY0ZsVCQpQ='
WHERE
key_id = '511d350b0c16f83b4b81367a23cc210b0e383d72e7cf7056be5ce4533b0ffcf7'
AND (
token = 'gn3Yw8RbH7Sek3UZPuyTsGivgX7LnuLbPkY0ZsVCQpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)