UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P+3o7Em/gVLAhWOl+BuGV6aJ20pjjndwXUqnTG4HvXE='
WHERE
key_id = '9dd47ac8a826b4bf2b5d0ecaa08455c1c7c193c764dcec641a1f0dc4bba9d575'
AND (
token = 'P+3o7Em/gVLAhWOl+BuGV6aJ20pjjndwXUqnTG4HvXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)