UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3DkHZuKq5wbemcXM/EjDI6fTsrQGY5onN6WIDhJ72vw=' 
WHERE 
  key_id = '5dd63426974bfe154de221a04c7dbc81898f4f951c0ab52c44b18007d376e122' 
  AND (
    token = '3DkHZuKq5wbemcXM/EjDI6fTsrQGY5onN6WIDhJ72vw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017