UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't/hZK0/twiQ37ztvsOlU0HNZPG2LIpPMtrLBcsqMME8='
WHERE
key_id = '3c475aa624254e25175a4407f3c4e417130f94f7f14520842bb01fa4de6769f7'
AND (
token = 't/hZK0/twiQ37ztvsOlU0HNZPG2LIpPMtrLBcsqMME8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)