UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WIh1Rd5A+2wn9LbGwL7oJ7xHrcv8srczsw4SxrtiQew='
WHERE
key_id = '9dcaa1abc7242d90379193a0bdaed5b72575f620aec95376a4005eb738d975fe'
AND (
token = 'WIh1Rd5A+2wn9LbGwL7oJ7xHrcv8srczsw4SxrtiQew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)