UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0xAKRPmdCDiwji9Sibf7ddRG3I5ApZgzZ33mHWa7zSo='
WHERE
key_id = '23397d32db182614c8b3313db2d01540ab6e483f5bfa6693166626761608eb22'
AND (
token = '0xAKRPmdCDiwji9Sibf7ddRG3I5ApZgzZ33mHWa7zSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)