UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V2fwqPGH8mcbn+XbMc+wAGjcRbbHYmd9aeC3eDHEl/U='
WHERE
key_id = '93901c67fe01baa476738dbca801cf09efef1e52914145a3768612d873ed0514'
AND (
token = 'V2fwqPGH8mcbn+XbMc+wAGjcRbbHYmd9aeC3eDHEl/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)