UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C/VaaLISidhbDFQkkcH9gL2yiCeRtaROWKXzMq6yqMw=' 
WHERE 
  key_id = '1102f118ee35ae81d9c86e23f62fb4111120fc6ea645646dd403fc1bda7bbc40' 
  AND (
    token = 'C/VaaLISidhbDFQkkcH9gL2yiCeRtaROWKXzMq6yqMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028