UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ezOt1A4P+JuXW51zLOQLhLOXpsd6LVQgLAZuumiXWHA=' 
WHERE 
  key_id = '4edb36a0b20a113145bdd138c13e99cf4d73421b7066c46a308af828d31645b8' 
  AND (
    token = 'ezOt1A4P+JuXW51zLOQLhLOXpsd6LVQgLAZuumiXWHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027