UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GGvzz8OZqW7/xZuUUWuPYl976/kI3vn6ePd8LSCohLQ=' 
WHERE 
  key_id = 'e0263b22aed01b6b29b409492bd8d3107aae586f8b799e33330efed0dfb31cc5' 
  AND (
    token = 'GGvzz8OZqW7/xZuUUWuPYl976/kI3vn6ePd8LSCohLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019