UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S2R5xYqe+4a1lfDzkoyjYlbKPNI7hxD0BUhyMBMi7BU=' 
WHERE 
  key_id = '2e2e0b2f867e637d0cca386c493f552fa1969d4d18ec3c29e8c799b5d74c428c' 
  AND (
    token = 'S2R5xYqe+4a1lfDzkoyjYlbKPNI7hxD0BUhyMBMi7BU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039