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

Query time 0.00030