UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HHBlyOW9Zqh6//H5YR7thIM6FBUezi1OlFr5WmwZz2M=' 
WHERE 
  key_id = '34f07b0f2e5c54b1b6908efe058bda1044a72121b56e69e5c7d0da992d343a36' 
  AND (
    token = 'HHBlyOW9Zqh6//H5YR7thIM6FBUezi1OlFr5WmwZz2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033