UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ggzR/R4VnmwaSZdDJaCScd0lNdKXvSLeL/ikArQSZ+U='
WHERE
key_id = 'ae49c7d476f9fccc291050f2308cdc73774bd9fadbdcaae0bc930a38c1e45545'
AND (
token = 'ggzR/R4VnmwaSZdDJaCScd0lNdKXvSLeL/ikArQSZ+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)