UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ft9XaaHIaLoOfjoNKaGYR0OJGDdYoJS2H/pPNVBhV/Y=' 
WHERE 
  key_id = '999554997197c1879b206bc0e076e939c3e68602c59fb4f946ee2614f87dfe38' 
  AND (
    token = 'Ft9XaaHIaLoOfjoNKaGYR0OJGDdYoJS2H/pPNVBhV/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015