UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mu29i85RVQZ5lXkCCEJYrbVWJJba9Ki2YPY4DwuBUjI=' 
WHERE 
  key_id = 'f78bd659decb9f7e8c50117d4355112c55a451e1c8b87d25b489a5d17214242a' 
  AND (
    token = 'mu29i85RVQZ5lXkCCEJYrbVWJJba9Ki2YPY4DwuBUjI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081