UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lUlnBOXYoDj96Jv5u0qMMZ8cxlaMngDScmr8oPU5Iiw=' 
WHERE 
  key_id = '0c6396ec621a42a89b0d8ce6d644b8bfdc3f74fbf0a41542a92a609d8a820796' 
  AND (
    token = 'lUlnBOXYoDj96Jv5u0qMMZ8cxlaMngDScmr8oPU5Iiw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034