UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mhqI5t8rmj8K7/Rg9R7yfqRO9dk3u7HsEaWfxBwdI/g=' 
WHERE 
  key_id = '2897768e84545a1ae608ce7c9254b7307dbbbc9b0abde18c1c2713e483a7a74c' 
  AND (
    token = 'mhqI5t8rmj8K7/Rg9R7yfqRO9dk3u7HsEaWfxBwdI/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030