UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aT74et6eQ/CTnP98yah4wdbck1lSAuHG6mzcj3pBrPs='
WHERE
key_id = '349da8cd95344227dd80d7de75c77ec154ba0f4e8de156bb08dd69507f480f69'
AND (
token = 'aT74et6eQ/CTnP98yah4wdbck1lSAuHG6mzcj3pBrPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)