UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q/IWC2b5T2awGc+0LLUekf2BoHnSwU2+9Ko/L9FfHNY=' 
WHERE 
  key_id = '03f585f113b2a1aab7ef286ee16f249ff7830fef09c9e98f9aea5b08a94bd2e9' 
  AND (
    token = 'Q/IWC2b5T2awGc+0LLUekf2BoHnSwU2+9Ko/L9FfHNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035