UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/IjnrlKxyF7ogM4pbiCO7piivLR4GLVG+UMNTSD1bMw=' 
WHERE 
  key_id = '9bd997c935f22989f6684b31acaac92f9586aef8453ea4e23095590bd051c37e' 
  AND (
    token = '/IjnrlKxyF7ogM4pbiCO7piivLR4GLVG+UMNTSD1bMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017