UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wEo4PNQHmrGF30vnd4KFHUHJtChu9uZvDbOE/yd9dZg='
WHERE
key_id = '6f925923fca6f86d5da6efcb725a0fb1d55f160627a7145ad7e219a1f92415a4'
AND (
token = 'wEo4PNQHmrGF30vnd4KFHUHJtChu9uZvDbOE/yd9dZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)