UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DfjF5OgsrvgZh3i0xtIn3Q7DoL/4b5CBcOtNOqVp2g0=' 
WHERE 
  key_id = 'dd0fcbe68003ea36c5091a78d2265f921fe3186910ed2206624fbd56b3b3e78a' 
  AND (
    token = 'DfjF5OgsrvgZh3i0xtIn3Q7DoL/4b5CBcOtNOqVp2g0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028