UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fGWmJZqrf4s9BikEOTgrDZDDki/p0Fox/Uu2VY8sAEI=' 
WHERE 
  key_id = '0e4a983d0323a864a065845794dba67091973ae3cd2e62c8c66444d21d38ce14' 
  AND (
    token = 'fGWmJZqrf4s9BikEOTgrDZDDki/p0Fox/Uu2VY8sAEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028