UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ah3WR/0N10wDEnHkdbGnbVooQ70igNxtbdv9Y9Yo4kA='
WHERE
key_id = 'a3454544f2e42ef5e232186962bebb4bd1aa8829e91efd8c29b484afb8c6afa3'
AND (
token = 'ah3WR/0N10wDEnHkdbGnbVooQ70igNxtbdv9Y9Yo4kA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)