UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fwd6LeBxNM9yonWm6fCpjUyRSr2KfuPfimxc+5cdVZQ='
WHERE
key_id = '51fbf985481dc3e661159ff039614943f99bd9c7e651b64c01b045f66203aeec'
AND (
token = 'fwd6LeBxNM9yonWm6fCpjUyRSr2KfuPfimxc+5cdVZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)